/*************************************************************************
	> File Name: vim mycmd.c
	> Author: H.M. Lau
	> Mail: hm.lau@outlook.com
	> Created Time: 2023/08/25 09:07
 ************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[], char *env[]) {
    if (argc != 2) {
        printf("Can not execute!\n");
        exit(1);
    }
    //printf("get the environment variable:%s\n", getenv("MY_VAL"));
    for (int i = 0; env[i]; ++i) printf("%s\n", env[i]);
    if (strcmp(argv[1], "-a") == 0) printf("hello a!\n");
    else if (strcmp(argv[1], "-b") == 0) printf("hello b!\n");
    else printf("Default\n");
    return 0;
}

